package com.shioirikukuri.util;

import com.shioirikukuri.redis.CommonRedisKey;
import org.springframework.data.redis.core.StringRedisTemplate;

/**
 * Created by shioirikukuri
 */
public class UserUtil {
    /**
     * 从Redis中根据用户token信息获取用户手机号码
     * @param redisTemplate
     * @param token
     * @return
     */
    public static String getUserPhone(StringRedisTemplate redisTemplate, String token){
        String strObj = redisTemplate.opsForValue().get(CommonRedisKey.USER_TOKEN.getRealKey(token));
        return strObj;
    }
}
